package com.salmon.controller;

import com.salmon.common.utils.MimeUtils;
import com.salmon.fastdfs.utils.FastDFSClient;
import org.apache.commons.io.FilenameUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.InputStreamResource;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.Base64Utils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.UUID;

@RestController
@RequestMapping("/file")
public class UserController {

    @Autowired
    private FastDFSClient fastDFSClient;

    @PostMapping("/upload")
    public void upload(@RequestParam("file") MultipartFile multipartFile) {
        try {
            String url = fastDFSClient.uploadFile(multipartFile);
            System.out.println(url);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    /**
     * @Description: 上传用户头像
     */
    @PostMapping("/uploadFaceBase64")
    public void uploadFaceBase64() throws Exception {

        String a = "iVBORw0KGgoAAAANSUhEUgAAAUYAAACaCAYAAADVXOEQAAAMJ2lDQ1BJQ0MgUHJvZmlsZQAASImVlwdYU8kWgOeWJCQktEDoEHoTpEiXXiMISBVshCSQUEJICCJ2dFHBtaBiwYquitjWAshiw4JtEez9gQiKsi4WbKi8SQLo6vfe+975vrn3z5kzZ845d+7kDgCqMWyRKBtVAyBHmC+ODQtkTkxOYZIeAwToA1VAAzibIxEFxMREAijD93/Ku1vQGsp1e5mvn/v/q6hzeRIOAEgM5DSuhJMD+QgAuBtHJM4HgNAL9WbT80WQiTBKoCmGAUI2l3GGgj1knKbgSLlNfGwQ5FQAlKhstjgDABVZXMwCTgb0o7IUsqOQKxBCboTsy+GzuZA/Qx6Vk5MLWdUasnXad34y/uEzbcQnm50xwopc5KIULJC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SVmJseOtT2Nu6J+4wqadonoOMLP4NPj9w7/h/d8kVogyCQ88cit6xraF+lIudm7+GRsEa5A35wjeeOw1vPntXHQPsrQ6HWqwGwh7X6uVYB9/NrXhjTptMQ7+qvvTy9gwHzO37cOL7z3D/riY9ciCVhuIUG5kEjEKeLTUt/8PzHtNEA+3W7cAAAAASUVORK5CYII=";

        byte [] bytes = Base64Utils.decodeFromString(a);

        String url = fastDFSClient.uploadFile(bytes, "png");
        System.out.println(url);
    }

    @GetMapping("/download")
    public ResponseEntity<Object> getFile(String fileUrl) throws IOException {
        HttpHeaders headers = new HttpHeaders();
        Resource resource = new InputStreamResource(fastDFSClient.downloadFile(fileUrl));
        String fileName = UUID.randomUUID().toString().replace("-", "") + "." + FilenameUtils.getExtension(fileUrl);
        headers.setContentDispositionFormData("attachment", URLEncoder.encode(fileName, StandardCharsets.UTF_8.displayName()));
        String mediaType = MimeUtils.getFileMimeType(fileName); // 根据文件名获取mediaType
        return ResponseEntity.ok().headers(headers).contentType(MediaType.parseMediaType(mediaType)).body(resource);
    }
}
